import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/LayoutView.vue'
import HomeView from '@/views/home/HomeView.vue'
import Cart from '@/components/cart/CartCard.vue'
import CartView from '@/views/cart/CartView.vue'
import OrderCard from '@/components/order/OrderCard.vue'
import MyView from '@/views/my/MyView.vue'
import ShopView from '@/views/shop/ShopView.vue'
import CartCard from '@/components/cart/CartCard.vue'
import OrderView from '@/views/order/OrderView.vue'
import OrderConfirm from '@/views/orderConfirmation/OrderConfirm.vue'
import AddressView from '@/views/address/AddressView.vue'
import CreateAddressView from '@/views/address/CreateAddressView.vue'


const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: '/',
      component: Layout,
      redirect:'/home',
      children:[
        {
          path:'/home',
          component:HomeView
        },
        {
          path:'/cart',
          component:CartView
        },
        {
          path:'/order',
          component:OrderCard
        },
        {
          path:'/my',
          component:MyView
        }
      ]
    },
    {
      path:'/goShop',
      component:ShopView
    },
    {
      path:'/goCount',
      component:OrderConfirm
    },
    {
      path:'/address',
      component:AddressView
    },
    {
      path:'/createaddress',
      component:CreateAddressView
    }
  ]
})

export default router
